package linwen.wang.tdddemo.controller;

import linwen.wang.tdddemo.vo.ProductInfo;
import linwen.wang.tdddemo.common.Result;
import linwen.wang.tdddemo.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
public class ProductController {
    @Autowired
    private ProductService productService;
    @GetMapping(value = "/getProecutsByIds/{ids}")
    public Result<List<ProductInfo>> getProductsByIds(@PathVariable @RequestBody List<Long> ids){
        List<ProductInfo> list = productService.getProductsByIds(ids);
        return new Result<>(list);
    }
}
